Component({

  properties: {
        top: Number,
        isshow : Boolean
    },

    data: {
        showstatus : false,
    },

    lifetimes: {
        attached() { },
        moved() { },
        detached() { },
    },


    attached() { },
    ready() {
        var now = new Date().getTime();
        var cache =  wx.getStorageSync('tomyxcx');       
        if( (!cache || !cache.status || cache.expire < now) && this.data.isshow ){           
            this.setData({
                showstatus : true
            })
        }
    },

    pageLifetimes: {
        // 组件所在页面的生命周期函数
        show() { },
        hide() { },
        resize() { },
    },

    methods: {
        hide() {
            var now = new Date().getTime();
            var cache =  wx.setStorageSync('tomyxcx',{status:1,expire:now+3600*24*1000});
            this.setData({
                showstatus : false,
            })
        },
    }

})